﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pay.aspx.cs" Inherits="StoreWeb.system.order.pay" %>



<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>编辑物料分类</title>
</head>
<body>
    <div class="pd-20">
        <form runat="server" method="post" class="form form-horizontal" id="formmemberadd">
            <%-- <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>分类名称：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="name" name="name" runat="server" datatype="*4-16" nullmsg="分类名称不能为空">
                </div>
                 <div class="col-4"> </div>
            </div>--%>
            <div class="row cl">
                <label class="form-label col-3">选择支付方式：</label>
                <div class="formControls col-6">
                    <asp:RadioButtonList ID="rdobtnpaytypelist" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">支付宝</asp:ListItem>
                        <asp:ListItem Value="1">微信</asp:ListItem>
                        <asp:ListItem Value="3">余额</asp:ListItem>
                    </asp:RadioButtonList>
                </div>
                <div class="col-4"></div>
            </div>
            <div class="row cl">
                <div class="col-10 col-offset-2">
                    <asp:HiddenField ID="hidid" runat="server" />
                    <asp:Button ID="btnok" runat="server" CssClass="btn btn-success radius" Text="确定" />
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="../../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
    <script>
        function order_buy(id) {
            if ($("input[name='rdobtnpaytypelist']:checked").val() == "3") {
                layer.confirm('你确定要付款该订单吗？', function (index) {
                    $.post("../../ajax/order.aspx", { action: "orderbuy", id: id, paytype: $("input[name='rdobtnpaytypelist']:checked").val() },
                           function (data) {
                               if (data == "1") {
                                   layer.msg('已支付!', { icon: 1, time: 1000 }, function () {
                                       parent.location.reload();
                                   });
                               } else if (data == "2") {
                                   layer.msg("门店余额不足", { icon: 0, time: 1000 });
                               }
                               else {
                                   layer.msg("操作失败", { icon: 0, time: 1000 });
                               }
                           });
                });
            } else if ($("input[name='rdobtnpaytypelist']:checked").val() == "0") {
               parent.location.href = "../../ajax/order.aspx?action=orderbuy&id=" + id + "&paytype=" + $("input[name='rdobtnpaytypelist']:checked").val();
            }
            else {
                layer.msg("该支付方式暂未开通！", { icon: 0, time: 1000 });
            }
        }
        $(function () {
            $("#formmemberadd").Validform({
                tiptype: 2,
                btnSubmit: "#btnok",
                //callback: function (form) {
                //    form[0].submit();
                //    var index = parent.layer.getFrameIndex(window.name);
                //    parent.$('.btn-refresh').click();
                //    parent.layer.close(index);
                //}
                //,
                beforeSubmit: function (curform) {
                    order_buy($("#hidid").val());
                    return false;
                }
            });
        });
    </script>
</body>
</html>
